﻿@*@model VehicleManagement.Models.FinanManInfo
*@
@model IEnumerable<VehicleManagement.Models.FinanManInfo>
@{
    ViewBag.Title = "FinanManInfoIndex";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<link href="../../Content/css/page_yk_index.css" rel="stylesheet" type="text/css" />
@Html.Partial("_PartviewAdminNav")
<div class="content bc">
    <div class="content_link_warn f12">
        你当前的位置：财务人员管理&gt&gt &nbsp;&nbsp;财务人员查询&gt&gt &nbsp;&nbsp;所有财务人员列表
    </div>
    <div class="content_right fr" id="rightcontent">
        <div class="column">
            <h4 class="title f14">
                财务人员列表
            </h4>
        </div>
        <div class="maincontent">
            <div class="menuwrap">
                <div class="submenu">
                    @using (Html.BeginForm("Index", "FinanManInfo", FormMethod.Get, new { id = "SearchForm" }))
                    {
                        @Html.Hidden("Page");
                        <div class="box_name dil m010">
                            <span class="label">姓名</span> <span>
                                <input type="text" class="txt_name w100" id="name" name="FinanMan_name"  title="输入要查找的姓名" />
                            </span>
                        </div>
                        <div class="box_sex dil m010">
                            <span class="label">性别</span> <span>
                                <select name="Sex">
                                    <option></option>
                                    <option>男</option>
                                    <option>女</option>
                                </select>
                            </span>
                        </div>
                         <div class="box_state dil m010">
@*                            <span class="label">状态</span> <span>
                                <select name="State">
                                    <option></option>
                                    <option>空闲</option>
                                    <option>忙碌</option>
                                </select>
                            </span>*@
                            <span class="label">电话</span>
                            <span>
                                <input type="text" name="Telephone" class="txt_name w100" title="输入电话号码" />
                            </span>
                        </div>
                        <div class="box_find dil m010">
                            <input type="submit" class="btn_fc f14" id="find" value="查询" title="查询记录" />
                        </div>
                        <div class="box_create dil m010">
                            <span class="btn_fc f14 h20" title="添加新记录">@Html.ActionLink("添加", "Create")</span>
                        </div>
                    }
                </div>
            </div>
            <div class="driveinfolist tc">
                <table class="tb_list f14">
                    <tr class="tr_head tf">
                        <th class="wp2">
                        </th>
                        <th class="wp15 tc bdl">
                            姓名
                        </th>
                        <th class="wp10 tc bdl">
                            性别
                        </th>
                        <th class="wp20 tc bdl">
                            联系电话
                        </th>
                        <th class="wp25 tc bdl">
                            电子邮箱
                        </th>
                        <th class="wp25 tc bdl">
                            操作
                        </th>
                        <th class="wp2 bdl">
                        </th>
                    </tr>
                    @foreach (var item in Model)
                    {
                        <tr>
                            <td>
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.FinanManName)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.Sex)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.Telephone)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.Email)
                            </td>
                            <td>
                                @Html.ActionLink("编辑", "Edit", new { id = item.FinanManID }) |
                                @Html.ActionLink("详情", "Details", new { id = item.FinanManID }) | <a href="javascript:void(0)" onclick="DeleteFinanMan(@item.FinanManID)">
                                    删除</a>
                            </td>
                            <td>
                            </td>
                        </tr>
                    }
                </table>
            </div>
            <div class="pagewrap">
                共<span id="TotalItems" class="allitems numstyle"></span>条记录， 每页显示<span id="ItemsPerPage"
                    class="itemsperpage numstyle"></span>条， 共<span id="TotalPages" class="allpages numstyle"></span>页，
                当前第<span id="CurrentPage" class="curpage numstyle"></span>页 <a id="FirstPage" class="fir_page"
                    href="javascript:void(0)">首页</a> <a id="PrevPage" class="pre_page" href="javascript:void(0)">
                        上一页</a> <a id="NextPage" class="next_page" href="javascript:void(0)">下一页</a>
                <a id="LastPage" class="last_page" href="javascript:void(0)">末页</a> <span>跳转到</span>
                <input type="text" class="input_page" id="PageToGo" />
                <input type="button" class="btn_gotopage" id="GoToPage" value="Go" />
            </div>
        </div>
    </div>
    @Html.Partial("_PartviewFinanmanLeftbar")
    <div class="content_contract fl">
        <a href="javascript:void(0)" class="btn_contract w8h32" id="contract" title="收缩">
        </a><a href="javascript:void(0)" class="btn_expand w8h32" id="expand" title="展开">
        </a>
    </div>
    <div class="cb">
    </div>
</div>
<script src="../../Scripts/deleteFunction.js" type="text/javascript"></script>
<script type="text/javascript" src="../../Scripts/jquery-1.5.1.js"></script>
<script src="@Url.Content("~/Scripts/jquery.query-2.1.7.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/SetPagingScript.js")" type="text/javascript"></script>
<script type="text/javascript">

    $(document).ready(function () {
        $("#driver_cx_content").toggle();
        $("tr:even").css("background-color", "#D7DBE4");

        if ($.query.get("Page") != "") {
            $("#Page").val($.query.get("Page"));
        }
        else {
            $("#Page").val(1);
        }

        if ($.query.get("FinanMan_name").toString() != "true") {
            $("input[name='FinanMan_name']").val($.query.get("FinanMan_name"));
        }

        if ($.query.get("Sex").toString() != "true") {
            $("select[name='Sex']").val($.query.get("Sex"));
        }

        if ($.query.get("Telephone").toString() != "true") {
            $("input[name='Telephone']").val($.query.get("Telephone"));
        }

        $.get("/FinanManInfo/GetPagingInfo",
            {
                FinanMan_name: $("input[name='FinanMan_name']").val(),
                Sex: $("select[name='Sex']").val(),
                Telephone: $("input[name='Telephone']").val(),
                Page: $("#Page").val()
            },
            function (data) {
                $("#TotalItems").text(data.TotalItems);
                $("#ItemsPerPage").text(data.ItemsPerPage);
                $("#TotalPages").text(data.TotalPages);
                $("#CurrentPage").text($("#Page").val());
            }
        );
        SetPagingOperation();

        function DeleteFinanMan(id) {
            if (confirm("你确认删除这条财务人员吗?")) {
                $.post("/FinanManInfo/DeleteFinanMan", "id=" + id, function (ret) {
                    if (ret.Result == "true") {
                        alert(ret.Message);
                        window.location.reload();
                    }
                    else {
                        alert(ret.Message);
                    }
                }, "json");
            }
        };
    });
 
</script>
